package sudroid.android.context;

import android.app.Activity;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.FrameLayout.LayoutParams;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import sudroid.LogUtils;

public class BaseActivity extends Activity
{
  private LinearLayout contentView;

  private void onPrepareDisplay()
  {
    WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes();
    onPrepareWindow(localLayoutParams);
    onPrepareTheme();
  }

  public ViewGroup getContentView()
  {
    if (this.contentView == null)
    {
      LinearLayout localLinearLayout1 = new LinearLayout(this);
      this.contentView = localLinearLayout1;
      LinearLayout localLinearLayout2 = this.contentView;
      FrameLayout.LayoutParams localLayoutParams = new FrameLayout.LayoutParams(-1, -1);
      localLinearLayout2.setLayoutParams(localLayoutParams);
      this.contentView.setBackgroundColor(0);
    }
    return this.contentView;
  }

  public Display getDefaultDisplay()
  {
    return getWindowManager().getDefaultDisplay();
  }

  protected void onCreate(Bundle paramBundle)
  {
    onPrepareDisplay();
    super.onCreate(paramBundle);
    ViewGroup localViewGroup = getContentView();
    super.setContentView(localViewGroup);
  }

  protected void onPrepareTheme()
  {
  }

  protected void onPrepareWindow(WindowManager.LayoutParams paramLayoutParams)
  {
  }

  public void setContentView(int paramInt)
  {
    LayoutInflater localLayoutInflater = getLayoutInflater();
    ViewGroup localViewGroup = getContentView();
    View localView = localLayoutInflater.inflate(paramInt, localViewGroup);
  }

  public void setContentView(View paramView)
  {
    ViewGroup localViewGroup = getContentView();
    if (localViewGroup != null)
    {
      localViewGroup.removeAllViews();
      getContentView().addView(paramView);
    }
    while (true)
    {
      return;
      LogUtils.w("Content view is null!");
    }
  }

  public void setContentView(View paramView, ViewGroup.LayoutParams paramLayoutParams)
  {
    ViewGroup localViewGroup = getContentView();
    if ((localViewGroup != null) && ((paramLayoutParams instanceof LinearLayout.LayoutParams)))
    {
      paramView.setLayoutParams(paramLayoutParams);
      localViewGroup.removeAllViews();
      getContentView().addView(paramView);
    }
    while (true)
    {
      return;
      LogUtils.w("Content view is null or params isn't LinearLayout.LayoutParams!");
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.android.context.BaseActivity
 * JD-Core Version:    0.6.0
 */